package com.example2;

import javax.swing.*;
import java.awt.*;

/**
 * @author Yancy
 * @program springioctest
 * @create 2020-08-31
 */
public class Demo01 {

  public static void main(String[] args) {
    //
      JFrame frame = new JFrame("JFrameDemo");

      JButton button = new JButton("Press me");
      JPanel contentPane = new JPanel();
      contentPane.setLayout(new BorderLayout());
      contentPane.add(button,BorderLayout.CENTER);
      frame.setContentPane(contentPane);
      //frame.getContentPane().add(button, BorderLayout.CENTER);
      frame.setSize(300,200);
      frame.setVisible(true);
      frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  }
}
